<?php
function get_project_status($project)
{
    switch ($project['status']) {
        case 1:
            $name = $project['type'] == 1 ? '市场' : '开发';
            return '等待' . $name . '人员确认';
            break;
        case 2:
            return '合同凭证资料上传';
            break;
        case 3:
            return '立项审核';
            break;
        case 4:
            return '审核失败';
            break;
        case 5:
            return '立项成功';
            break;
        case 6:
            return '落定审核';
            break;
        case 7:
            return '审核失败';
            break;
        case 8:
            return '落定成功';
            break;
        case 9:
            return '变更审核';
            break;
        case 10:
            return '审核失败';
            break;
        case 11:
            return '申请变更成功';
            break;
        case 12:
            return '财务审核';
            break;
        case 13:
            return '审核失败';
            break;
        case 14:
            return '变更中';
            break;
        case 15:
            return '完成审核';
            break;
        case 16:
            return '审核失败';
            break;
        case 17:
            return '完成';
            break;
    }
}

function setLog($pid,$status,$old_status,$uid,$message) {
    db('rongcui_project_log')->insert([
        'pid' => $pid,
        'status' => $status,
        'old_status' => $old_status,
        'uid' => $uid,
        'create_time' => time(),
        'message' => $message
    ]);
}